<selector v-model="query.gitId" :data="gitDatas | filter_gits(language)"
          fields="id,name"
          @change="git_change"
          :enum-count="1"
          chk="*"></selector>
<script type="text/ecmascript-6" setup>




//定义 vue2的this,当前组件
const $self = getCurrentInstance();

//定义 $attrs
const $attrs = useAttrs();



//定义data
const $data = reactive({"willAddList":[]});


const $props = defineProps({

});





const list = ref();

//定义事件
const $emit = defineEmits(["update:modelValue","loaded"]);



const git_change = function(v) {
    this.git = this.gitDatas.find(it => it.id == v) || {};
    this.git.folders
        .groupBy(it => {
            return it.path
        })
        .forEach(it => {
            if (it.data.length > 1) {
                it.data.forEach(it => {
                    it.path += " (" + it.name + ")"
                })
            }
        });
    jv.$saveData("query",$data.query)
    var def = {};
    if (jv.asBoolean(top.location.json._com_)) {
        def._com_ = true;
    }
    jv.saveToHistoryUrlQuery(top, Object.assign(def, this.query), true)
};
const loadGitInfo = function() {
    var productLineCode = this.query.productLineCode;
    if (!productLineCode) {
        return;
    }
    this.git = {};
    if (this.data[productLineCode]) {
        this.gitDatas = this.data[productLineCode];
        this.git = this.gitDatas.find(it => it.id == this.query.gitId) || {};
    } else {
        jv.$http.post("/dev/git-data/list", {productLineCode: productLineCode}).then(res => {
            this.data[productLineCode] = res.data.data;
            this.gitDatas = this.data[productLineCode];
            this.git = this.gitDatas.find(it => it.id == this.query.gitId) || {};
        })
    }
};

onMounted( function() {
    loadGitInfo();
} )



</script>